#pragma once
#include "data_type.h"
#include <algorithm>
#include <iterator>
namespace segment {

Point sum(Point a, Point b) {
  Point c;
  c.x = a.x + b.x;
  c.y = a.y + b.y;
  c.z = a.z + b.z;
  return c;
}
//get the center point in 2d
Center get_center(Point a, Point b) {
  Center c;
  c.x = (a.x + b.x) / 2;
  c.y = (a.y + b.y) / 2;
  return c;
}

// provide sort information for class cloudpoint to
// get min and max value
inline bool compare_x_axis(PointCloud &p, PointCloud &q) { return p.x < q.x; }

inline bool compare_y_axis(PointCloud &p, PointCloud &q) { return p.y < q.y; }

inline bool compare_z_axis(PointCloud &p, PointCloud &q) { return p.z < q.z; }

}